<template>
  <el-aside width="190px">
    <el-menu
      :default-active="route.fullPath"
      class="el-menu-vertical-demo"
      :collapse="$store.state.isCollapse"
      :collapse-transition="false"
      :router="true"
    >
      <el-menu-item v-if="store.state.roleCodes.includes('Dashboard')" index="/Dashboard">
        <el-icon><HomeFilled /></el-icon>
        <span>Dashboard</span>
      </el-menu-item>
      <el-menu-item v-if="store.state.roleCodes.includes('PTList')" index="/PTList">
        <el-icon><List /></el-icon>
        <span>PTList</span>
      </el-menu-item>
      <el-menu-item v-if="store.state.roleCodes.includes('Report')" index="/report">
        <el-icon><OfficeBuilding /></el-icon>
        <span>Report</span>
      </el-menu-item>
      <el-sub-menu v-if="store.state.roleCodes.includes('Roles-setting') || store.state.roleCodes.includes('Account-setting')" index="/setings">
        <template #title>
          <el-icon><Tools /></el-icon>
          <span>Settings</span>
        </template>
        <el-menu-item v-if="store.state.roleCodes.includes('Roles-setting')" index="/setings/settings-role">Roles setting</el-menu-item>
        <el-menu-item v-if="store.state.roleCodes.includes('Account-setting')" index="/setings/settings-account">Account setting</el-menu-item>
      </el-sub-menu>
    </el-menu>
  </el-aside>
</template>

<script setup>
import {
  HomeFilled,
  Avatar,
  UserFilled,
  MessageBox,
  Reading,
  Tools,
  Pointer,
  List,
  OfficeBuilding
} from '@element-plus/icons-vue'
import { useRoute } from 'vue-router'
import { useStore } from 'vuex'
const route = useRoute()

const store = useStore()

</script>

<style lang="scss" scoped>
.el-aside {
  height: calc(100vh - 60px);
  .el-menu {
    height: calc(100vh - 70px);
  }
  box-shadow: 3px -3px 3px #d4d4d4;
}

</style>
